<template>
  <BasicDrawer v-bind="$attrs" @register="registerDrawer" title="账号详情" width="600px">
    <Description :column="1" :data="roleData" @register="registerDescription" />
  </BasicDrawer>
</template>
<script lang="ts" setup>
  import { ref, useAttrs } from "vue"
  import { BasicDrawer, useDrawerInner } from "/@/components/Drawer"
  import { formDetailSchema } from "./data"
  import { getMpAccount } from "./api"
  import { Description, useDescription } from "/@/components/Description/index"
  const emit = defineEmits(["register"])
  const attrs = useAttrs()
  const roleData = ref({})
  const [registerDescription] = useDescription({
    schema: formDetailSchema,
    labelStyle: {
      marginLeft: "10px",
      width: "90px",
    },
  })
  const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
    setDrawerProps({ confirmLoading: false })
    roleData.value = await getMpAccount({ id: data.record.id })
  })
</script>
